package com.joysuch.wwyt.bp.bean.investigate;

import cn.zlg.common.springmvc.validate.constraints.NotNull;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.google.common.collect.Lists;
import com.joysuch.wwyt.app.bean.AppInvestigateDto;
import com.joysuch.wwyt.bp.bean.BpBaseUserBean;
import com.joysuch.wwyt.bp.bean.investigate.vo.BpPlanNameVO;
import com.joysuch.wwyt.bp.bean.investigate.vo.JobBeanVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.Id;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import java.time.LocalDate;
import java.util.Date;
import java.util.List;

/**
 * @Author ZhangDong
 * @Date 2020/3/25 16:17
 */
@Data
public class BpInvestigatePlanBean {

    @Id
    @ApiModelProperty("主键id--修改时传")
    private Long id;
    @ApiModelProperty("排查计划名称")
    @NotBlank(message = "排查计划名称不能为空")
    private String checkPlanName;
    @ApiModelProperty("排查类型id")
    @NotNull(message = "排查类型id不能为空")
    private Long typeId;
    @ApiModelProperty("排查类型名称")
    private String typeName;
    @ApiModelProperty("排查方式")
    @NotEmpty(message = "排查方式不能为空")
    private String checkWay;
    @ApiModelProperty("备注")
    private String remark;
    @ApiModelProperty("排查频率: 临时性; 周期性")
    @NotEmpty(message = "排查频率不能为空")
    private String checkRate;
    @ApiModelProperty("排查频次")
    @NotEmpty(message = "排查频次不能为空")
    private String checkRateDescribe;
    @ApiModelProperty("关联排查表id")
    @NotNull(message = "请选择关联排查表")
    private Long safeTableId;
    @ApiModelProperty("关联排查表名称")
    @NotEmpty(message = "关联排查表名称不能为空")
    private String safeTableName;
    @ApiModelProperty("排查项目id集合json串")
    private List<Long> checkItemIds = Lists.newArrayList();
    @ApiModelProperty("排查项目集合")
    private List<BpSafeTableItemBean> itemBeanList;
    @ApiModelProperty("app排查计划下--排查项目集合")
    private List<AppInvestigateDto> appItemBeanList;

    @ApiModelProperty("指定人员集合")
    private List<BpBaseUserBean> userList;
    @ApiModelProperty("异常和提醒人员集合")
    private List<BpBaseUserBean> remindUserList;

    private List<BpPlanNameVO> departs;
    private List<BpPlanNameVO> jobs;

    @ApiModelProperty("周期单位: 日; 月")
    private String periodUnit;
    @ApiModelProperty("日/月 周期设置,eg: 按天 每1天")
    private Integer periodDays;
    @ApiModelProperty("周期月 开始时间")
    private Integer monthStartDate;

    @ApiModelProperty("日/月 周期设置,eg: 按周 周一")
    private List<Integer> periodList;

    @ApiModelProperty("计划排查日期- 临时性排查频率生效")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private LocalDate planDate;

    @ApiModelProperty("计划排查日期- 非周期行计划结束时间")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private LocalDate planEndDate;

    @ApiModelProperty("排查地点")
    private String checkLocation;

    @ApiModelProperty("启用/停用")
    private String initiateStatus = "停用";

    @ApiModelProperty("责任部门")
    private Long dutyDepartId;
    @ApiModelProperty("责任部门名称")
    private String dutyDepartName;

    @ApiModelProperty("排查岗位集合")
    private List<JobBeanVo> checkJobList;

    private String checkJobJson;

}
